﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGiLinetype : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGiLinetype(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGiLinetype obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGiLinetype()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGiLinetype(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdGiLinetype() : this(GlobalsPINVOKE.new_OdGiLinetype(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isContinuous()
		{
			bool result = GlobalsPINVOKE.OdGiLinetype_isContinuous(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isByBlock()
		{
			bool result = GlobalsPINVOKE.OdGiLinetype_isByBlock(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setByBlock(bool value)
		{
			GlobalsPINVOKE.OdGiLinetype_setByBlock(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isByLayer()
		{
			bool result = GlobalsPINVOKE.OdGiLinetype_isByLayer(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setByLayer(bool value)
		{
			GlobalsPINVOKE.OdGiLinetype_setByLayer(this.swigCPtr, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public double patternLength()
		{
			double result = GlobalsPINVOKE.OdGiLinetype_patternLength(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternLength(double patternLength)
		{
			GlobalsPINVOKE.OdGiLinetype_setPatternLength(this.swigCPtr, patternLength);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int numDashes()
		{
			int result = GlobalsPINVOKE.OdGiLinetype_numDashes(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setNumDashes(int count)
		{
			GlobalsPINVOKE.OdGiLinetype_setNumDashes(this.swigCPtr, count);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void dashAt(int index, OdGiLinetypeDash dash)
		{
			GlobalsPINVOKE.OdGiLinetype_dashAt__SWIG_0(this.swigCPtr, index, OdGiLinetypeDash.getCPtr(dash));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiLinetypeDash dashAt(int index)
		{
			OdGiLinetypeDash result = new OdGiLinetypeDash(GlobalsPINVOKE.OdGiLinetype_dashAt__SWIG_1(this.swigCPtr, index), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDashAt(int index, double value)
		{
			GlobalsPINVOKE.OdGiLinetype_setDashAt__SWIG_0(this.swigCPtr, index, value);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDashAt(int index, OdGiLinetypeDash dash)
		{
			GlobalsPINVOKE.OdGiLinetype_setDashAt__SWIG_1(this.swigCPtr, index, OdGiLinetypeDash.getCPtr(dash));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void dashes(OdGiLinetypeDashArray dashes)
		{
			GlobalsPINVOKE.OdGiLinetype_dashes(this.swigCPtr, OdGiLinetypeDashArray.getCPtr(dashes));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setDashes(OdGiLinetypeDashArray dashes)
		{
			GlobalsPINVOKE.OdGiLinetype_setDashes(this.swigCPtr, OdGiLinetypeDashArray.getCPtr(dashes));
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
